<template>
  <div class="service-header">
    <div class="header-content">
      <div class="location-info">
        <span class="location-text">请选择地址</span>
        <img src="@/assets/imgs/arrow_down_3.png" alt="下拉" class="dropdown-icon" />
      </div>
      <div class="header-actions">
        <div class="action-item" @click="openCustomerService">
          <img src="@/assets/imgs/customer.svg" alt="客服" class="action-icon" />
        </div>
        <div class="action-item" @click="openNotifications">
          <img src="@/assets/imgs/message.svg" alt="消息" class="action-icon" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ElMessage } from 'element-plus'

const openCustomerService = () => {
  ElMessage.info('客服功能开发中...')
}

const openNotifications = () => {
  ElMessage.info('消息功能开发中...')
}
</script>

<style scoped>
.service-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: transparent;
  position: relative;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.location-info {
  display: flex;
  align-items: center;
  cursor: pointer;
  min-width: 80px;
}

.location-text {
  font-size: 16px;
  color: #333;
  font-weight: 500;
  margin-right: 4px;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
}

.header-actions {
  display: flex;
  gap: 16px;
}

.action-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 50%;
}

.action-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.action-icon {
  width: 20px;
  height: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .service-header {
    padding: 8px 12px;
  }
  
  .location-info {
    min-width: 60px;
  }
  
  .location-text {
    font-size: 14px;
  }
  
  .action-item {
    width: 32px;
    height: 32px;
  }
  
  .action-icon {
    width: 18px;
    height: 18px;
  }
}
</style>
